package com.hnkywl.sts.entity.sys;

import com.hnkywl.sts.entity.BaseEntity;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.List;

/**
 * 说明：
 * 包:        com.hnkywl.sts.entity.sys
 * 类描述:    二级物资编码
 * 创建人:    zcg
 * 创建时间: 13-2-18 上午10:24
 * 修改人:    zcg
 * 修改时间: 13-2-18 上午10:24
 * 修改备注: [说明本次修改内容]
 * 版本:        [v1.0]        e
 */
@Entity
@Table(name = "T_SYS_RJWZBM")
@Where(clause = "deleted!='1'")
public class Rjwzbm extends BaseEntity {
    @Id
    @SequenceGenerator(name = "seqRjwzbm", allocationSize = 1, sequenceName = "SEQ_SYS_RJWZBM")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqRjwzbm")
    private Long id;
    /**
     * 二级物资编码名称
     */
    @Column(name = "name")
    private String name;
    /**
     * 二级物资编码
     */
    @Column(name = "code")
    private String code;
    /**
     * 所属一级物资编码
     */
    @ManyToOne
    @JoinColumn(name = "yjwzbm_id")
    @Where(clause = "deleted!='1'")
    private Yjwzbm yjwzbm;
    /**
     * 所包含的品名
     */
    @OneToMany(mappedBy = "rjwzbm", cascade = CascadeType.ALL,
            fetch = FetchType.LAZY, targetEntity = Pm.class)
    @Where(clause = "deleted!='1'")
    private List<Pm> pmList;
    /**
     * 简称
     */
    private String jc;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Yjwzbm getYjwzbm() {
        return yjwzbm;
    }

    public void setYjwzbm(Yjwzbm yjwzbm) {
        this.yjwzbm = yjwzbm;
    }

    public List<Pm> getPmList() {
        return pmList;
    }

    public void setPmList(List<Pm> pmList) {
        this.pmList = pmList;
    }

    public String getJc() {
        return jc;
    }

    public void setJc(String jc) {
        this.jc = jc;
    }

}
